chore(miner): migrate the CLI bin entry-points to TypeScript - #7318
Conversation
Phase 3, batch 3.4 of the plain-.js-to-TypeScript migration proposed in JSONbored#7290 (Phase 1's tsc build pipeline landed in JSONbored#7299): converts the two bin entry-points -- bin/loopover-miner.js and bin/loopover-miner-mcp.js -- to real, compiler-verified .ts using the same in-place-emit pattern (tsc emits the .js/.d.ts next to each .ts source, so the published bin layout and every consumer's import path stay identical). The MCP bin's hand-maintained MinerMcpServerOptions interface moves from its now-removed .d.ts sibling into the source; tsc regenerates the declaration. Two spots needed the source to satisfy types the untyped .js never had to: the manage-status tool widens its minimal read-surface injection seams back to the store types collectManageStatus/collectRunPortfolio ask for (both only ever read, so it never reaches an omitted write method), and the package.json version read resolves via fileURLToPath(import.meta.url) rather than a `new URL(...)` object so it also typechecks under the repo-root tsconfig the MCP unit tests pull this file into. The miner-package pack allowlist gains bin/loopover-miner.d.ts (tsc now emits one for the CLI entry, mirroring the mcp bin's existing .d.ts entry). Closes JSONbored#7308
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7318 +/- ##
=======================================
Coverage 93.82% 93.82%
=======================================
Files 706 706
Lines 69570 69570
Branches 18895 18895
=======================================
Hits 65275 65275
Misses 3302 3302
Partials 993 993
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-19 16:16:42 UTC
Review summary Nits — 6 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
validate-tests (runs test:coverage, uploads lcov to Codecov) only
triggered on backend||rees, so a PR touching only packages/loopover-miner,
packages/loopover-mcp, packages/loopover-engine, or packages/discovery-index
skipped the coverage job entirely -- no codecov/patch check posted, and the
required validate check passed anyway since a skipped job counts as
success. Three JS->TS migration PRs merged this way with zero tests run.
Extends validate-tests/validate-tests-merge's trigger to also fire on
miner/mcp/engine/discoveryIndex (mirroring the existing rees precedent),
adds a discoveryIndex path filter, and closes the matching coverage.include
gaps: packages/loopover-miner/bin/** and packages/loopover-mcp/{lib,bin}/**
were missing from vitest's coverage.include, which is why PR JSONbored#7318 passed
codecov/patch with no real data. The two CLI entrypoints that are
provably subprocess-only-tested (loopover-miner.ts, loopover-mcp.js/ts)
are exempted in codecov.yml the same documented way src/server.ts already
is, since v8 can't instrument a separate Node process.
chore(miner): migrate the CLI bin entry-points to TypeScript
Phase 3, batch 3.4 of the plain-.js-to-TypeScript migration proposed in
#7290 (Phase 1's tsc build pipeline landed in #7299): converts the two bin
entry-points -- bin/loopover-miner.js and bin/loopover-miner-mcp.js -- to
real, compiler-verified .ts using the same in-place-emit pattern (tsc emits
the .js/.d.ts next to each .ts source, so the published bin layout and every
consumer's import path stay identical).
The MCP bin's hand-maintained MinerMcpServerOptions interface moves from its
now-removed .d.ts sibling into the source; tsc regenerates the declaration.
Two spots needed the source to satisfy types the untyped .js never had to:
the manage-status tool widens its minimal read-surface injection seams back
to the store types collectManageStatus/collectRunPortfolio ask for (both only
ever read, so it never reaches an omitted write method), and the package.json
version read resolves via fileURLToPath(import.meta.url) rather than a
new URL(...)object so it also typechecks under the repo-root tsconfig the MCPunit tests pull this file into.
The miner-package pack allowlist gains bin/loopover-miner.d.ts (tsc now emits
one for the CLI entry, mirroring the mcp bin's existing .d.ts entry).
Closes #7308